<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>批次开始操作</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<style>
			.mui-bar {
				background-color: #0088BB;
			}
			
			.mui-title {
				color: #FFFFFF
			}
			
			a {
				color: #FFFFFF
			}
			
			.mui-slider {
				z-index: 1;
				margin-top: 20px;
				overflow: hidden;
				width: 90%;
			}
			
			.mui-table-view .mui-media-object {
				line-height: 90px;
				max-width: 90px;
				height: 90px;
			}
			
			.mui-table-view-cell.mui-active {
				/*background-color: #EC971F;*/
			}
			
			.mui-input-row label {
				font-family: 'Helvetica Neue', Helvetica, sans-serif;
				line-height: 1.1;
				float: left;
				width: 20%;
				padding: 11px 15px;
			}
			
			.mui-input-row label~input,
			.mui-input-row label~select,
			.mui-input-row label~textarea {
				float: right;
				width: 80%;
				margin-bottom: 0;
				padding-left: 0;
				border: 0;
			}
			/*text-indent属性规定文本块中首行文本的缩进。 注释:允许使用负值*/
			
			table tr {
				/*text-indent: 20px;*/
				line-height: 30px;
			}
			
			input {
				/*				float: right !important;*/
				/*height: 35px;*/
				/*display: block;*/
			}
			
			.mui-content-padded {
				padding: 10px;
			}
			
			.lotMaterial {
				background-color: chartreuse;
			}
			
			body,
			body .mui-content {
				background-color: #fff !important;
			}
			
			p {
				color: #000000
			}
			
			code {
				word-wrap: break-word;
				word-break: normal;
				font-size: 90%;
				/*color: #c7254e;*/
				background-color: #f9f2f4;
				border-radius: 4px;
			}
		</style>
	</head>

	<body id="mInput" @keydown="keydown">
		<header class="mui-bar mui-bar-nav" id="user">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">批次开始{{name}}</h1>
		</header>
		<div class="mui-content" id="lotStart">
			<ul class="mui-table-view" style="margin-top: 10px;">
				<li class="mui-table-view-cell">
					<h4>设备:<span>{{eqpID}}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;状态：<span id="Remote">{{CONTROLSTATUS}}</span></h4>
				</li>
			</ul>
			<div class="mui-input-row" v-show="lotinfo.IsProcessStart!=true">
				<label>LOT</label>
				<input ref="input" id="inputId" type="text" @keyup="keyup" class="mui-input" placeholder="请扫描批次条码">
			</div>

			<div class="mui-input-row">
				<!--{{lotinfo}}-->
				<ul class="mui-table-view" style="margin-top: 10px;">

					<li class="mui-table-view-cell mui-media">
						<table>
							<tr>
								<td>
									<p>LOT ID：<span id="hname">{{lotinfo.LotId}}</span></p>
								</td>
							</tr>
							<tr>
								<td>
									<p>数量：<span><input class="mui-input-numbox" type="number" style="width: 100px;height: 20px;" v-model="TotalQty" value="{{lotinfo.TotalQty}}" /></span></p>
								</td>
							</tr>
							<tr>
								<td>
									<p>Device：<span>{{lotinfo.Device}}</span></p>
								</td>
							</tr>
							<tr>
								<td>
									<p>WaferSource：<span>{{lotinfo.WaferSource}}</span></p>
								</td>
							</tr>
							</tr>
							<tr>
								<td>
									<p>Recipe名称：<span>{{lotinfo.RecipeId}}</span></p>
								</td>
							</tr>
							<tr>
								<td>
									<p>Recipe编号：<span>{{lotinfo.RecipeNo}}</span></p>
								</td>
							</tr>
							<tr v-if="lotMaterials != undefined">
								<td>
									<h5>本批次应使用物料</h5>
								</td>
							</tr>
							<tr v-for="lotMaterial in lotMaterials" class="lotMaterial">

								<td v-show="lotMaterial.Type=='wire'">
									<p>铜线编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>
								<td v-show="lotMaterial.Type == 'capillary'">
									<p>劈刀编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>
								<td v-show="lotMaterial.Type == 'expoxy'">
									<p>银浆编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>
								<td v-show="lotMaterial.Type == 'wafer'">
									<p>晶圆编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>
								<td v-show="lotMaterial.Type == 'hubblade'">
									<p>硬刀编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>
								<td v-show="lotMaterial.Type == 'hublessblade'">
									<p>软刀编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>

								<td v-show="lotMaterial.Type == 'carrier'">
									<p>载具编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>
								<td v-show="lotMaterial.Type == 'ems'">
									<p>EMC编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>
								<td v-show="lotMaterial.Type == 'leadframe'">
									<p>框架编码:<span>{{lotMaterial.MaterialPartNo}}</span></p>
								</td>
							</tr>
						</table>
					</li>
				</ul>
			</div>
			<div class="mui-input-row">

				<ul class=" mui-table-view mui-table-view-chevron">
					<li class="mui-table-view-cell">
						<h5>设备当前物料</h5>
					</li>
					<div v-for="(todo, index) in todos">

						<template v-if="todo.Type== 'Wire'">
							<li class="mui-table-view-cell">

								<div class="mui-slider-left mui-disabled">
									<a class="mui-btn mui-btn-red" v-on:click="UnloadWire">删除</a>
								</div>
								<div class="mui-slider-handle">
									铜线
								</div>
								<button type="button" class="mui-btn mui-btn-blue" v-on:click="open1">更换</button>
							</li>
							<li class="mui-table-view-cell">
								铜线批次:<span>{{todo.SeqNo}}</span>
							</li>
							<li class="mui-table-view-cell">
								铜线PartNo:<span>{{todo.MaterialPartNo}}</span>
							</li>
							<li class="mui-table-view-cell">
								铜线直径:<span>{{todo.Size}}</span>
							</li>
						</template>
						<template v-if="todo.Type == 'Capillary'">
							<li class="mui-table-view-cell">

								<div class="mui-slider-left mui-disabled">
									<a class="mui-btn mui-btn-red" v-on:click="UnloadCapillary">删除</a>
								</div>
								<div class="mui-slider-handle">
									劈刀
								</div>
								<button type="button" class="mui-btn mui-btn-blue" v-on:click="open1">更换</button>
							</li>
							<li class="mui-table-view-cell">
								劈刀批次:<span>{{todo.SeqNo}}</span>
							</li>
							<li class="mui-table-view-cell">
								劈刀PartNo:<span>{{todo.MaterialPartNo}}</span>
							</li>
						</template>

						<template v-if="todo.Type== 'Wafer'">
							<li class="mui-table-view-cell">

								<div class="mui-slider-left mui-disabled">
									<a class="mui-btn mui-btn-red" v-on:click="UnloadWafer">删除</a>
								</div>
								<div class="mui-slider-handle">
									晶圆
								</div>
								<button type="button" class="mui-btn mui-btn-blue" v-on:click="open1">更换</button>
							</li>
							<li class="mui-table-view-cell">
								Device:<span>{{todo.Device}}</span>
							</li>
							<li class="mui-table-view-cell">
								WaferSource:<span>{{todo.WaferSource}}</span>
							</li>
							<li class="mui-table-view-cell">
								焊接图:<span>{{todo.Diagram}}</span>
							</li>
							<li class="mui-table-view-cell">
								批次号:<span>{{todo.MaterialPartNo}}</span>
							</li>
						</template>
						<template v-if="todo.Type == 'Expoxy'">
							<li class="mui-table-view-cell">

								<div class="mui-slider-left mui-disabled">
									<a class="mui-btn mui-btn-red" v-on:click="UnloadExpoxy">删除</a>
								</div>
								<div class="mui-slider-handle">
									银浆
								</div>
								<button type="button" class="mui-btn mui-btn-blue" v-on:click="open1">更换</button>
							</li>
							<li class="mui-table-view-cell">
								物料编码:<span>{{todo.MaterialPartNo}}</span>
							</li>
							<li class="mui-table-view-cell">
								解冻完成:<span>{{todo.ThawEndTime}}</span>
							</li>
						</template>

						<template v-if="todo.Type== 'HubBlade'">
							<li class="mui-table-view-cell">

								<div class="mui-slider-left mui-disabled" v-on:click="UnloadHubBlade">
									<a class="mui-btn mui-btn-red">删除</a>
								</div>
								<div class="mui-slider-handle">
									晶圆刀片
								</div>
								<button type="button" class="mui-btn mui-btn-blue" v-on:click="open1">更换</button>
							</li>
							<li class="mui-table-view-cell">
								型号:<span>{{todo.MaterialPartNo}}</span>
							</li>
							<li class="mui-table-view-cell">
								刀刃长度:<span>{{todo.SawLength}}</span>
							</li>
							<li class="mui-table-view-cell">
								刀刃厚度:<span>{{todo.SawThickness}}</span>
							</li>
							<li class="mui-table-view-cell">
								刀批次号:<span>{{todo.SeqNo}}</span>
							</li>
						</template>
						<template v-if="todo.Type == 'HublessBlade'">
							<li class="mui-table-view-divider">
								<div class="mui-slider-left mui-disabled">
									<a class="mui-btn mui-btn-red" v-on:click="UnloadHublessBlade">删除</a>
								</div>
								<div class="mui-slider-handle">
									芯片刀片
								</div>
								<button type="button" class="mui-btn mui-btn-blue" v-on:click="open1">更换</button>
							</li>
							<li class="mui-table-view-cell">
								批次号:<span>{{todo.SeqNo}}</span>
							</li>
							<li class="mui-table-view-cell">
								外径:<span>{{todo.ExternalDiameter}}</span>
							</li>
							<li class="mui-table-view-cell">
								内径:<span>{{todo.InternalDiameter}}</span>
							</li>
							<li class="mui-table-view-cell">
								厚度:<span>{{todo.SawThickness}}</span>
							</li>
							<li class="mui-table-view-cell">
								型号:<span>{{todo.ID}}</span>
							</li>
						</template>
					</div>
					<li class="mui-table-view-cell" v-show="DiagramUrl == true">
						<a class="mui-navigate-right" href="welding.html">
							<p>焊线图：<span>{{lotinfo.Diagram}}</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>焊线图版本：</span><span>{{lotinfo.DiagramVersion}}</span></p>
						</a>
					</li>
				</ul>
			</div>
			<!--
            	作者：1055471363@qq.com
            	时间：2018-03-15
            	描述：此处注释不要删掉EAP暂未处理，后边会加
            -->
			<!--<div class="mui-input-row">
				<table border="" cellspacing="" cellpadding="" width="100%">
					<tr>
						<th>料盒信息</th>
						<th>提篮信息</th>
					</tr>
					<tr>
						<td>
							<input class="mui-input-numbox" type="text" style="width: 99%;height: 25px;" v-model="Remark" />
						</td>
						<td>
							<input class="mui-input-numbox" type="text" style="width: 99%;height: 25px;" v-model="Remark" />
						</td>
					</tr>
				</table>
			</div>-->

			<form class="mui-input-group">
				<div class="mui-input-row" id="app">
					<label>备注</label>
					<input type="text" class="mui-input-clear" placeholder="" v-model="Remark" id="remake">
				</div>
			</form>
			<br>
			<div>
				<button type="button" v-show="lotinfo.IsProcessStart==false" class="mui-btn mui-btn-primary mui-btn-block mui-btn-outlined" @click="processStart" style="border-radius: 20px;margin:0 auto;width:100%">开始作业</button>
				<button type="button" v-show="lotinfo.IsProcessStart==true" class="mui-btn mui-btn-danger mui-btn-block mui-btn-outlined" @click="processEnd" style="border-radius: 20px;margin:0 auto;width:100%;">结束作业</button>
			</div>
			<a href="#" v-on:click="moreMessage" class="mui-content-padded mui-pull-right">加载更多</a>
			<h4 class="mui-content-padded mui-pull-left">实时消息：</h4>
			<div v-for="message in messages" class="mui-input-row">
				<code :style="{ 'color': message.COLOR }">{{message.MESSAGE}}</code>
			</div>
			<br/>

		</div>

		<script src="../../js/mui.js"></script>
		<script type="text/javascript" src="../../js/app.js"></script>
		<script type="text/javascript" src="../../js/immersed.js"></script>
		<script type="text/javascript" src="../../base.js"></script>
		<script src="../../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init({
				swipeBack: true //启用右滑关闭功能
			})

			//执行自定义事件

			window.addEventListener('refresh', function(e) { //执行刷新
				location.reload();
			});
			var localEqp = localStorage.getItem("localEqp");
			var user = localStorage.getItem("user");
			var responseEqp
			var IsProcessStart //是否开始作业

			Vue.config.devtools = true
			var app = new Vue({
				el: '#user',
				data: {
					name: "(" + '工号：' + user + ")"
				}
			});

			var Size = ''
			var RemainTime = ''
			var SeqNo = ''
			var MaterialPartNo = ''

			var Device = ''
			var WaferSource = ''
			var Diagram = ''
			var ThawEndTime = ''
			var SawLength = ''
			var SawThickness = ''
			var ExternalDiameter = ''
			var InternalDiameter = ''
			//			var eqpStatus
			var vm = new Vue({
				el: '#lotStart',
				data: {
					eqpID: localEqp,
					todos: {},
					lotMaterials: {},
					lotId: "",
					Remark: '',
					lotinfo: {},
					messages: {},
					DiagramUrl: false,
					TotalQty: '',
					CONTROLSTATUS: '', //设备状态,
					eqpMaterialType: '',
					i18nEqpMaterialType: '' //设备类型中文
				},
				mounted: function() {
					this.showMessage();
					this.lotStart();
				},
				methods: {
					open1: function() {
						var _this = this;
						var win = window.open(_this.Wire);
					},
					open2: function() {
						var _this = this;
						var win = window.open(_this.Capillary);
					},
					open3: function() {
						var _this = this;
						var win = window.open(_this.Wafer);
					},
					open4: function() {
						var _this = this;
						var win = window.open(_this.Expoxy);
					},
					open5: function() {
						var _this = this;
						var win = window.open(_this.HubBlade);
					},
					open6: function() {
						var _this = this;
						var win = window.open(_this.HublessBlade);
					},
					moreMessage: function() {
						window.open('messages.html')
					},
					processEnd: function() {
						window.open('lotsEnd.html');
					},
					UnloadWire: function() {
						var _this = this
						_this.eqpMaterialType = 'Wire'
						_this.i18nEqpMaterialType = '铜线'
						_this.UnloadEQPMeterial()
					},
					UnloadCapillary: function() {
						var _this = this
						_this.eqpMaterialType = 'Capillary'
						_this.i18nEqpMaterialType = '劈刀'
						_this.UnloadEQPMeterial()
					},
					UnloadWafer: function() {
						var _this = this
						_this.eqpMaterialType = 'Wafer'
						_this.i18nEqpMaterialType = '晶圆'
						_this.UnloadEQPMeterial()
					},
					UnloadExpoxy: function() {
						var _this = this
						_this.eqpMaterialType = 'Expoxy'
						_this.i18nEqpMaterialType = '银浆'
						_this.UnloadEQPMeterial()
					},
					UnloadHubBlade: function() {
						var _this = this
						_this.eqpMaterialType = 'HubBlade'
						_this.i18nEqpMaterialType = '硬刀'
						_this.UnloadEQPMeterial()
					},
					UnloadHublessBlade: function() {
						var _this = this
						_this.eqpMaterialType = 'HublessBlade'
						_this.i18nEqpMaterialType = '软刀'
						_this.UnloadEQPMeterial()
					},
					UnloadEQPMeterial: function() {
						var _this = this
						var btnArray = ['否', '是'];
						var todo = _this.todos
						for(var i = 0; i < todo.length; i++) {
							Size = todo[i].Size
							RemainTime = todo[i].RemainTime
							SeqNo = todo[i].SeqNo
							MaterialPartNo = todo[i].MaterialPartNo

							Device = todo[i].Device
							WaferSource = todo[i].WaferSource
							Diagram = todo[i].Diagram
							ThawEndTime = todo[i].ThawEndTime
							SawLength = todo[i].SawLength
							SawThickness = todo[i].SawThickness
							ExternalDiameter = todo[i].ExternalDiameter
							InternalDiameter = todo[i].InternalDiameter
						}
						mui.confirm('确定删除该物料？', _this.i18nEqpMaterialType, btnArray, function(e) {
							if(e.index == 0) {
								//alert(e.index)
							} else {

								mui.ajax(base + '/UnloadEQPMeterial/index.json', {
									data: {
										EqpId: localEqp,
										OPID: user,
										Type: _this.eqpMaterialType,

										Name: user,

										Size: Size,
										RemainTime: RemainTime,
										SeqNo: SeqNo,
										MaterialPartNo: MaterialPartNo,

										Device: Device,
										WaferSource: WaferSource,
										Diagram: Diagram,
										ThawEndTime: ThawEndTime,
										SawLength: SawLength,
										SawThickness: SawThickness,
										ExternalDiameter: ExternalDiameter,
										InternalDiameter: InternalDiameter
									},
									dataType: 'json', //服务器返回json格式数据
									type: 'post', //HTTP请求类型
									timeout: 10000, //超时时间设置为10秒；
									success: function(data) {
										mui.alert(data.MESSAGE)
										_this.lotStart();
									},
									error: function(xhr, type, errorThrown) {
										mui.toast("网络异常，删除物料请求失败")
									}
								});
							}
						})
					},
					processStart: function() {
						var _this = this;
						var Remark = _this.Remark
						var TotalQty = _this.TotalQty;
						var lotId = localStorage.getItem("lotId");
						var btnArray = ['取消', '确定'];
						mui.confirm('确定开始作业，确认？', '提示', btnArray, function(e) {
							if(e.index == 1) {
								mui.ajax(base + '/StartProcess/index.json', {
									data: {
										EqpId: localEqp,
										LotId: lotId,
										USERNAME: user,
										Remark: Remark,
										TotalQty: TotalQty
									},
									dataType: 'json', //服务器返回json格式数据
									type: 'post', //HTTP请求类型
									timeout: 120000, //超时时间设置为10秒；
									//									beforeSend: function() {
									//										plus.nativeUI.showWaiting("数据请求中...");
									//										mask.show(); //显示遮罩层
									//									},
									//									complete: function() {
									//										plus.nativeUI.closeWaiting();
									//										mask.close(); //关闭遮罩层
									//									},
									success: function(data) {
										mui.alert(data.MESSAGE);
										_this.lotStart();
									},
									error: function(xhr, type, errorThrown) {
										mui.toast("网络异常，开始作业请求失败")
									}
								});
							} else {
								mui.toast("请仔细检查")
							}
						})
					},
					lotStart: function() {
						var _this = this;
						//						mui.ajax('../../json/lotStart.json', {
						_this.Wire = "cgMetarial.html?Type=Wire&EqpId=" + localEqp
						_this.Capillary = "cgMetarial.html?Type=Capillary&EqpId=" + localEqp
						_this.Wafer = "cgMetarial.html?Type=Wafer&EqpId=" + localEqp
						_this.Expoxy = "cgMetarial.html?Type=Expoxy&EqpId=" + localEqp
						_this.HubBlade = "cgMetarial.html?Type=HubBlade&EqpId=" + localEqp
						_this.HublessBlade = "cgMetarial.html?Type=HublessBlade&EqpId=" + localEqp
						mui.ajax(base + '/showEQPInfoC2eFORe2C/index.json', {
							data: {
								EQPID: localEqp
							},
							dataType: 'json', //服务器返回json格式数据
							type: 'post', //HTTP请求类型
							timeout: 120000, //超时时间设置为10秒；
							async: true,
							success: function(data) {

								var mm = data.MATERIALINFO.MATERIALINFO;
								if(mm === undefined) {
									mui.alert("设备未设置BOM，请联系相关人员")
								} else {
									if(mm instanceof Array) {
										_this.todos = mm;
									} else {
										_this.todos = [];
										_this.todos.push(mm);
									}
								}
								//								eqpStatus = data.CONTROLSTATUS
								if(data.LOTINFO) {
									//批次信息
									_this.lotinfo = data.LOTINFO
									IsProcessStart = data.LOTINFO.IsProcessStart
									//批次物料
									_this.lotMaterials = data.LOTINFO.Materials.MesMaterial
									//批次数量
									_this.TotalQty = data.LOTINFO.TotalQty
								} else {
									console.log('eqp lot is null')
									mui.alert("请扫描批次条码")
								}
								console.log(data.LOTINFO)
								//设备状态
								_this.CONTROLSTATUS = data.CONTROLSTATUS

								if(data.LOTINFO.Diagram === undefined) {
									_this.DiagramUrl = false
								} else {
									var Diagram = data.LOTINFO.Diagram
									_this.DiagramUrl = true

									//									alert(_this.lotMaterials)
									//焊线图数据
									var DiagramUrl = data.LOTINFO.Diagram
									var DiagramVersion = data.LOTINFO.DiagramVersion
									localStorage.setItem("DiagramUrl", DiagramUrl);
									localStorage.setItem("DiagramVersion", DiagramVersion);
									responseEqp = data.EQPID
								}
							},
							error: function(xhr, type, errorThrown) {
								mui.toast("网络异常，请求设备信息失败");
							}
						});
					},
					showMessage: function() {
						var _this = this;
						setInterval(function() {
							mui.ajax(base + '/SHOWMESSAGE/index.json', {
								data: {
									EQPID: localEqp,
									max: 5
								},
								dataType: 'json', //服务器返回json格式数据
								type: 'post', //HTTP请求类型
								timeout: 2000, //超时时间设置为10秒；
								async: true,
								success: function(data) {
									_this.messages = data;
									//震动
									navigator.vibrate = navigator.vibrate ||
										navigator.webkitVibrate ||
										navigator.mozVibrate ||
										navigator.msVibrate;
									for(var i = 0; i < data.length; i++) {
										if(data[i].ISALERT) { //震动
											navigator.vibrate([400, 300, 200, 100]);
											mui.alert(data[i].MESSAGE)
										}
										//设备状态切换
										if(data[i].ISEQPSTATUS == true) {
											_this.CONTROLSTATUS = data[i].EQPSTATUS
										} else {

										}
									}
								},
								error: function(xhr, type, errorThrown) {
									//									mui.toast(new Date() + type)
									//									mui.toast('实时消息' + type)
								}
							});
						}, 2000);
					},
					keyup(e) {
						if(e === null || e.keyCode === 13) {
							var _this = this;
							localStorage.setItem("lotId", e.target.value);
							var lotId = localStorage.getItem("lotId");

							mui.ajax(base + '/LotIn/index.json', {
								data: {
									EQPID: localEqp,
									LOTID: lotId,
									USERNAME: user,
									num: Math.random()
								},
								dataType: 'json', //服务器返回json格式数据
								type: 'post', //HTTP请求类型
								timeout: 120000, //超时时间设置为10秒；
								async: true,
								success: function(data) {
									//关闭软键盘
									document.activeElement.blur();
									_this.lotinfo = data;
									if(data.Materials.MesMaterial === undefined) {
										//										_this.lotMaterials = data.Materials.MesMaterial
										console.log('无批次物料')
									} else {
										_this.lotMaterials = data.Materials.MesMaterial
									}
									IsProcessStart = data.IsProcessStart
									_this.TotalQty = data.TotalQty
									var Diagram = data.Diagram
									if(Diagram === undefined) {
										console.log("没有焊线图")
										_this.DiagramUrl = false
									} else {
										_this.DiagramUrl = true
										var DiagramUrl = data.Diagram
										var DiagramVersion = data.DiagramVersion
										localStorage.setItem("DiagramUrl", DiagramUrl);
										localStorage.setItem("DiagramVersion", DiagramVersion);
									}
									responseEqp = data.EQPID
								},
								error: function(xhr, type, errorThrown) {
									mui.toast("网络异常，请求lot信息失败");
								}
							});　
							//清除文本
							e.target.value = '';

						}
					}
				}
			})

			document.onkeydown = function(e) { //对整个页面文档监听
				var keyNum = window.event ? e.keyCode : e.which; //获取被按下的键值
				//判断如果用户按下了回车键（keycody=13）
				//console.log("keyNum:"+keyNum);
				if(keyNum == 119) {
					document.getElementById("inputId").focus();
				}
			}

			//备份mui.back，mui.back已将窗口关闭逻辑封装的比较完善（预加载及父子窗口），因此最好复用mui.back
			var old_back = mui.back;
			mui.back = function() {
				var btn = ['取消', '确定'];
				mui.confirm('确认退出批次开始界面？', '提示', btn, function(e) {
					console.log(e.index)
					if(e.index == 1) {
						console.log(IsProcessStart)
						if(IsProcessStart == false) {
							//请求后台
							mui.ajax(base + '/RemoveEQPLot/index.json', {
								data: {
									EQPID: localEqp
								},
								dataType: 'json', //服务器返回json格式数据
								type: 'post', //HTTP请求类型
								timeout: 10000, //超时时间设置为10秒；
								success: function(data) {
									mui.alert(data)

								},
								error: function(xhr, type, errorThrown) {
									mui.toast("网络异常，解绑请求失败");
								}
							});
							//执行mui封装好的窗口关闭逻辑；

						} else {
							console.log('批次已经开始')
						}
						old_back();
					}
				});
			}
		</script>
	</body>

</html>